<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>

</head>
<style>
    .appguide-wrap {
        display: block;
        margin: 15px 10px;
        border-radius: 5px;
        box-shadow: 0 0 6px #ddd;
        overflow: hidden;
        background: #31546b;
        background-image: repeating-linear-gradient(60deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .1) 15px, transparent 0, transparent 30px);
    }

    .appguide-wrap .appguide-txt {
        padding: 15px 10px;
        font-size: 16px;
        line-height: 26px;
        color: #fff;
    }

    .appguide-wrap .appguide-btns {
        display: flex;
        line-height: 40px;
        text-align: center;
        background: #fff;
    }

    .appguide-wrap .appguide-btns span {
        flex: 1;
    }

    .appguide-wrap .appguide-btns span:first-child {
        background: #f5f5f5;
        color: #999;
    }
</style>
<body>

<link rel="stylesheet" href="https://cdn.bootcss.com/sweetalert/0.5.0/sweet-alert.css"/>
<link rel="stylesheet" href="css/hhh.css"/>

<script src="https://unpkg.com/axios@0.19.2/dist/axios.min.js"></script><!--axios-->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script><!--vue插件-->
<div id="chapterName">
    <div class="header_wap pc_none">
        <span class="title">笔趣阁</span>
        <a class="user" href="##">
            <svg class="lnr lnr-user">
                <use xlink:href="#lnr-user"></use>
            </svg>
        </a>
    </div>
    <div class="header_top"></div>
    <div class="header">
        <div class="wrap">
            <h1 class="logo"><a href="/">笔趣阁</a></h1>
            <div class="search">
                <form action="/" id="form">
                    <input class="text" id="keyWord" name="q" v-model="novelName" type="text"
                           placeholder="可搜书名和作者，请您少字也别输错字。"/>
                    <input type="submit" class="btn" @click="queryNovel" value="搜索"/>
                </form>
            </div>
        </div>
        <div class="nav">
            <ul class="nav">
                <li><a href="/index.html">首页</a></li>
                <li><a href="#" @click="chapterNameType('玄幻小说')">玄幻小说</a></li>
                <li><a href="#" @click="chapterNameType('修真小说')">修真小说</a></li>
                <li><a href="#" @click="chapterNameType('都市小说')">都市小说</a></li>
                <li><a href="#" @click="chapterNameType('穿越小说')">穿越小说</a></li>
                <li><a href="#" @click="chapterNameType('网游小说')">网游小说</a></li>
                <li><a href="#" @click="chapterNameType('科幻小说')">科幻小说</a></li>
                <li><a href="#" @click="chapterNameType('其他小说')">其他小说</a></li>
                <li><a href="/setSearch.html">添加小说</a></li>
            </ul>
        </div>
    </div>
    <div class="book">
        <div class="path wap_none">
            <a href="/">笔趣阁</a> &gt; 玄{{novel.novelName}}最新章节列表
            <span class="oninfo"><a class="ll" rel="nofollow" title="更新报错留言" href="#">更新报错</a> | <a rel="nofollow" href="#comment">直达底部</a></span>
        </div>
        <div class="info">
            <div class="cover">
                <img :alt="novel.novelName"
                     :src="novel.url" />
            </div>
            <h1>{{novel.novelName}}</h1>
            <div class="small">
                <span>{{novel.name}}</span>
                <span>{{novel.completionStatus|novelStatus}}</span>
            </div>
            <div class="readlink">
                <a rel="nofollow" href="#" >加入书架</a>
            </div>
            <div class="intro">
                <dl>
                    <dt>
                        内容简介：
                    </dt>
                    <dd>
                        {{novel.briefIntroduction}}
                    </dd>
                </dl>
            </div>
        </div>



    </div>
    <div class="listmain">
        <dl>
            <dt>
                {{novel.novelName}}<span>正文</span>
            </dt>
            <dd>
                <li v-for="(item,index) in chapter"><a :href="'/novelContent.html?chapterNameId='+item.id">{{item.chapterName}}</a>
                <!--<a href="/book/16947/1612.html">第1613章太好了</a>-->
            </dd>
        </dl>
    </div>

    <div class="footer" id="footer">
        <div class="pc-footer">
            <p>本站所有小说为转载作品，所有章节均由网友上传，转载至本站只是为了宣传本书让更多读者欣赏。</p>
        </div>
        <div class="m-footer">
            <a href="/index.html">首页</a>
            <a href="#">顶部↑</a>
        </div>
    </div>
</div>
<script>
    new Vue({
        el: '#chapterName',
        data: {
            novel: [],
            chapter: [],
        },
        filters: {
            novelType: function (value) {
                if (value == 0) {
                    return "玄幻小说"
                } else if (value == 1) {
                    return "修真小说"
                } else if (value == 2) {
                    return "都市小说"
                } else if (value == 3) {
                    return "穿越小说"
                } else if (value == 4) {
                    return "网游小说"
                } else if (value == 5) {
                    return "科幻小说"
                } else {
                    return "其他小说"
                }

            },
            novelStatus: function (value) {
                if (value) {
                    return "完结"
                } else {
                    return "连载中"
                }
            }
        },
        methods: {
            chapterNameType: function (e) {
                window.location.href = "/chapterNameType.html?type=" + e;
            },
            queryNovel: function () {
                window.location.href = "/searchNovelByName.html?novelName=" + this.novelName

            }
        },
        created: function () {
            var that = this;
            let novelId = decodeURI(window.location.href.split('?')[1].split('=')[1]);
            let token = window.sessionStorage.getItem('token');
            axios.get("/chapter/query/" + novelId, {headers: {'Authorization': token}}).then(function (res) {
                if (res.data.code) {
                    that.novel = res.data.extend.success[0]
                    that.chapter = that.novel.chapterNames;
                } else {
                    alert("请您先登录");
                    window.location.href = "/login.html"
                }

            })


        }

    })
</script>
</body>
</html>
